package com.xuecheng.media.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Date:2023/7/19
 * Author:丐版小杨哥
 * Description:
 */
@Configuration
public class MinioConfig {
    @Value("${minio.endpoint}")
    private String endpoint;
    //账号
    @Value("${minio.accessKey}")
    private String accessKey;
    //密码
    @Value("${minio.secretKey}")
    private String secretKey;
    @Bean
    public MinioClient minioClient(){
        MinioClient minioClientBuilder= MinioClient.builder().endpoint(endpoint).credentials(accessKey, secretKey).build();
        return minioClientBuilder;
    }
}
